/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *如果数据库字段发生变化,请在代码生成器重新生成此Model
 */
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SqlSugar;
using VOL.Entity.SystemModels;

namespace VOL.Entity.DomainModels
{
    [SugarTable("salesreturnorderitemmodel", TableDescription = "销售退货单明细表")]
    [Entity(TableCnName = "销售退货单明细表", TableName = "salesreturnorderitemmodel")]
    public partial class SalesReturnOrderItemModel : BaseEntity
    {
        /// <summary>
        /// 主键
        /// </summary>
        [SugarColumn(IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
        [Key]
        [Display(Name = "主键")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public long Id { get; set; }

        /// <summary>
        /// 关联 销售退货单主表 的 ID
        /// </summary>
        [SugarColumn(ColumnName = "returnOrderId")]
        [Display(Name = "关联销售退货单主表的ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? returnOrderId { get; set; }

        /// <summary>
        /// 关联  销售订单的销售单号
        /// </summary>
        [SugarColumn(ColumnName = "purchaseOrderItemCode")]
        [Display(Name = "关联销售订单的销售单号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string purchaseOrderItemCode { get; set; }

        /// <summary>
        /// 货品ID（关联 货品表）
        /// </summary>
        [SugarColumn(ColumnName = "goodsId")]
        [Display(Name = "货品ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? goodsId { get; set; }

        /// <summary>
        /// 货品编号（从进货明细表反填）
        /// </summary>
        [SugarColumn(ColumnName = "goodsCode")]
        [Display(Name = "货品编号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string goodsCode { get; set; }

        /// <summary>
        /// 货品名称（从进货明细表反填）
        /// </summary>
        [SugarColumn(ColumnName = "goodsName")]
        [Display(Name = "货品名称")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string goodsName { get; set; }

        /// <summary>
        /// 规格型号（从进货明细表反填）
        /// </summary>
        [SugarColumn(ColumnName = "specModel")]
        [Display(Name = "规格型号")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string specModel { get; set; }

        /// <summary>
        /// 单位 ID（关联 ** 单位表（unitmodel）** 的 Id）
        /// </summary>
        [SugarColumn(ColumnName = "unitId")]
        [Display(Name = "单位ID")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? unitId { get; set; }

        /// <summary>
        /// 单位名称（从进货明细表反填）
        /// </summary>
        [SugarColumn(ColumnName = "unitName")]
        [Display(Name = "单位名称")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string unitName { get; set; }

        /// <summary>
        /// 本次退货数量（用户输入，需≤进货数量且≥0）
        /// </summary>
        [SugarColumn(ColumnName = "returnQuantity")]
        [Display(Name = "本次退货数量")]
        [Column(TypeName = "int")]
        [Editable(true)]
        public int? returnQuantity { get; set; }

        /// <summary>
        /// 进货单价（从进货单明细表反填）
        /// </summary>
        [SugarColumn(DecimalDigits = 2, ColumnName = "purchasePrice")]
        [Display(Name = "进货单价")]
        [Column(TypeName = "decimal(10,2)")]
        [Editable(true)]
        public decimal? purchasePrice { get; set; }

        /// <summary>
        /// 退货金额（自动计算：returnQuantity * purchasePrice）
        /// </summary>
        [SugarColumn(DecimalDigits = 2, ColumnName = "returnAmount")]
        [Display(Name = "退货金额")]
        [Column(TypeName = "decimal(10,2)")]
        [Editable(true)]
        public decimal? returnAmount { get; set; }

        /// <summary>
        /// 明细备注（用户输入）
        /// </summary>
        [SugarColumn(ColumnName = "remarks")]
        [Display(Name = "明细备注")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string remarks { get; set; }

        /// <summary>
        /// 是否逻辑删除
        /// </summary>
        [SugarColumn(ColumnName = "isDel")]
        [Display(Name = "是否逻辑删除")]
        [Column(TypeName = "tinyint")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public sbyte isDel { get; set; }

        /// <summary>
        /// 创建人
        /// </summary>
        [SugarColumn(ColumnName = "Creator")]
        [Display(Name = "创建人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string creator { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [SugarColumn(ColumnName = "CreateTime")]
        [Display(Name = "创建时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        [Required(AllowEmptyStrings = false)]
        public DateTime? createTime { get; set; }

        /// <summary>
        /// 最后修改人
        /// </summary>
        [SugarColumn(ColumnName = "Modifier")]
        [Display(Name = "最后修改人")]
        [Column(TypeName = "longtext")]
        [Editable(true)]
        public string modifier { get; set; }

        /// <summary>
        /// 最后修改时间
        /// </summary>
        [SugarColumn(ColumnName = "ModifyDate")]
        [Display(Name = "最后修改时间")]
        [Column(TypeName = "datetime")]
        [Editable(true)]
        public DateTime? modifyDate { get; set; }

        /// <summary>
        /// 出库明细表的id
        /// </summary>
        [SugarColumn(ColumnName = "stockOutItemId")]
        [Display(Name = "出库明细表的id")]
        [Column(TypeName = "bigint")]
        [Editable(true)]
        public long? stockOutItemId { get; set; }
    }
}


